Customizing
the Recording Process
You can
customize the recording process, taking complete control of most everything from creating the MCIWnd window to saving the
recorded information in a file. The following example queries the MCI device
for recording and saving capabilities, and includes menu commands to record at
the beginning or end of the content.
The following
example uses the MCIWndCreate
The example
uses the MCIWndCanRecord
case WM_COMMAND:
switch
(wParam)
{
case
IDM_CREATEMCIWND:
g_hwndMCIWnd = MCIWndCreate( hwnd, g_hinst,
WS_VISIBLE | WS_CHILD |
MCIWNDF_RECORD,
// add Record button
NULL );
MCIWndNew(g_hwndMCIWnd, "waveaudio"); // new file
if( MCIWndCanRecord(g_hwndMCIWnd) )
{
MessageBox( hwnd,
"Press the red button on the toolbar to record.",
"MCIWnd Record",
MB_OK );
}
else
{
MessageBox( hwnd,
"This device doesn't record.",
"MCIWnd Record",
MB_OK );
}
break;
case
IDM_RECORDATSTART:
if(
MCIWndCanRecord(g_hwndMCIWnd) )
{
MCIWndHome(g_hwndMCIWnd);
MCIWndRecord(g_hwndMCIWnd);
}
else
{
MessageBox( hwnd,
"This device doesn't
record.",
"MCIWnd Record",
MB_OK);
}
break;
case
IDM_RECORDATEND:
if( MCIWndCanRecord(g_hwndMCIWnd) )
{
MCIWndEnd(g_hwndMCIWnd);
MCIWndRecord(g_hwndMCIWnd);
}
else
{
MessageBox( hwnd,
"This device doesn't record.",
"MCIWnd Record",
MB_OK);
}
break;
case
IDM_SAVEMCIWND:
if( MCIWndCanSave(g_hwndMCIWnd) )
MCIWndSaveDialog(g_hwndMCIWnd);
}
break;
// Handle
other messages here.